namespace Atlantis
{
    public class Node : GLib.Object
    {
        private string text;
        private Node parent;
        private string id;
        
        public string Id {
			get {
				return id;
			}
		}
        
        public Node Parent
        {
            get
            {
                return parent;
            }
			protected set
            {
                this.parent = value;
            }
        }

        public string Text
        {
            get
            {
                return this.text;
            }
            set
            {
                this.text = value;
            }
        }

        public Node()
        {
			id = uuid_generate_string();
			stderr.printf(id);
			stderr.printf("\n");
        }
        
        public void accept(INodeVisitor visitor)
        {
			visitor.before_visit_node(this);
			on_accept(visitor);
			visitor.after_visit_node(this);
		}
		
		public virtual void on_accept(INodeVisitor visitor)
		{
			visitor.visit_node (this);
		}
    }
}
